package com.synergy.stockflow.constant;

import lombok.Getter;

public enum ResultCode {

    SUCCESS(200, "操作成功"),
    FAIL(500, "操作失败"),
    PARAM_IS_INVALID(400, "参数无效"),
    UNAUTHORIZED(401, "未授权访问"),
    FORBIDDEN(403, "无权限操作"),
    DATA_NOT_EXIST(404, "数据不存在"),
    REQUEST_LIMIT(429, "请求繁忙"),
    BUSINESS_EXCEPTION(5001, "业务异常"),
    SYSTEM_EXCEPTION(5002, "系统异常"),
    ERROR(500,"操作失败" );


    @Getter
    private final int value;
    @Getter
    private final String desc;

    ResultCode(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int value() {

        return value;
    }

}